package com.kingland.hailin.service;

import com.kingland.hailin.mapper.UserModelMapper;
import com.kingland.hailin.model.UserModel;
import org.springframework.stereotype.Service;

import java.util.List;

/*
@Name: UserServiceImpl
@Author: zhouhailin
@Date: 2021/5/25
@Time: 7:55 下午
@Description： 
*/
@Service
public class UserServiceImpl implements UserService{

    private UserModelMapper userModelMapper;

    //构造器注入方式
    public UserServiceImpl(UserModelMapper userModelMapper) {
        this.userModelMapper = userModelMapper;
    }

    @Override
    public UserModel addUser(UserModel userModel) {
        this.userModelMapper.insert(userModel);
        return null;
    }

    @Override
    public List<UserModel> findAll() {
        return userModelMapper.selectAll();
    }

    @Override
    public UserModel Login(UserModel model) {
        return userModelMapper.selectByUserNameAndPassword(model);
    }

}
